/**
 * @description: Switcher
 */

import type { CommonAPI } from '../types/all'
import { defHttp } from '../http'

/** 交换机详情 */
export const getSwitcherDetailApi: CommonAPI<'/v1/switcher', 'get'> = params =>
  defHttp.get(`/v1/switcher`, { params })

/** 删除交换机 */
export const deleteSwitcherApi: CommonAPI<'/v1/switcher', 'delete'> = params =>
  defHttp.delete(`/v1/switcher`, { params })

/** 新增交换机 */
export const addSwitcherApi: CommonAPI<'/v1/switcher', 'post'> = data =>
  defHttp.post(`/v1/switcher`, data)

/** 修改交换机 */
export const updateSwitcherApi: CommonAPI<'/v1/switcher', 'patch'> = data =>
  defHttp.patch(`/v1/switcher`, data)

/** 交换机列表 */
export const getSwitcherListApi: CommonAPI<
  '/v1/switcher/list',
  'get'
> = params => defHttp.get(`/v1/switcher/list`, { params })

/** 列举交换机型号 */
export const getSwitcherSwNumApi: CommonAPI<
  '/v1/switcher/sw_num',
  'get'
> = params => defHttp.get(`/v1/switcher/sw_num`, { params })
